ActionController::Routing::Routes.draw do |map|
  map.resources :reviews

  map.connect '', :controller => 'home', :action => 'home'

  map.resources :jobs
  map.resource :search

  map.resources :disciplines, :member => { :college => :get, :leave => :any, :invite => :get, :send_invite => :post } do |disciplines|
    disciplines.resources :memberships
    disciplines.resources :discussions do |discussions|
      discussions.resources :discussion_comments
    end
    disciplines.resources :articles do |articles|
      articles.resources :article_comments
      articles.resources :reviews
    end
  end

  map.resources :profiles, :member => { :articles => :get, :home => :get } do |profiles|
    profiles.resource  :friendship, :member => { :send_request => :get,
                                                 :decline      => :delete,
                                                 :withdraw      => :delete}
    profiles.resources :messages
  end

  map.resources :users, :member => { :personal                => :get,
                                      :vitae                  => :get,
                                      :password               => :get,
                                      :additional_information => :get,
                                      :upload_vitae           => :post,
                                      :delete_vitae           => :delete,
                                      :assets                 => :get} do |users|
    users.resources :invites
    users.resource :photos
  end

  map.resources :schools, :jobs

  map.from_plugin :sourdough

  map.articles_list 'articles_list', :controller => 'articles', :action => 'index'
  map.home '', :controller => 'home', :action => 'home'
  map.terms '/home/terms', :controller => 'home', :action => 'terms'

end
